package sxt.entity;

import java.util.Date;

//公告类
public class Announcement {
    int id;
    String announcement;
    /*注意:为什么这个地方是Date,但是前台仍然可以按中国时间格式输出?
    *
    * 解释:因为公告展示逻辑用的是Ajax请求,使用了json格式,会自动把Date类型转换为对应的json格式的2022年4月20日15:38:37
    *       json格式本质是字符串,所以可以. 如果不转换成json或字符串,前台仍然会显示 欧洲时间格式.
    * */
    Date time;//yyyyMMddhhmmss

    public Announcement(int id, String announcement, Date time) {
        this.id = id;
        this.announcement = announcement;
        this.time = time;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getAnnouncement() {
        return announcement;
    }

    public void setAnnouncement(String announcement) {
        this.announcement = announcement;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }
}
